function clearAdv() {
    var head = document.getElementsByTagName('head')[0];
    var children = head.childNodes;
    var res;
    var source = 'HKtrust'; //信任资源
    for (var i in children) {
        if (children.hasOwnProperty(i)) {
            tagName = children[i].tagName;
            if (tagName && tagName == 'SCRIPT') {
                res = children[i].dataset['res'];
                if (res != source) {
                    head.removeChild(children[i]);
                }
            }
        }
    }
    var body = document.getElementsByTagName('body')[0];
    if (body) {
        children = body.childNodes;
        for (var k in children) {
            if (children.hasOwnProperty(k)) {
                var tagName = children[k].tagName;
                if (tagName) {
                    res = children[k].dataset['res'];
                    if (res != source) {
                        body.removeChild(children[k]);
                    }
                }
            }
        }
    }
}
clearAdv();